function mapping = diffMapping(cover, stego, dim, drawgraph)
    if nargin < 4
        drawgraph = 0;
    end
    m = zeros(1, 256);
    d = zeros(1, 256);
    q = zeros(1, 256);
    for i = 1:256
        nbin = 50;
        c = cover(:,i);
        s = stego(:,i);
        mc = mean(c);
        ms = mean(s);
        m(i) = abs(mc - ms);
        d(i) = std(c)^2 + std(s)^2;
        q(i) = m(i) ./ (d(i).^0.5);
        if drawgraph
        ma = max(max(c), max(s));
        bins = 0:ma/nbin:ma;
        hist([c s], bins);
        h = hist([c s], bins);
        z = sum(abs(h(1,:) - h(2,:)));
        mh = max(max(h));
        %lc = line([mc, mc],[0, mh]);
        %ls = line([ms, ms],[0, mh]);
        tc = text(mc, mh, '^');
        ts = text(ms, mh, '^');
        disp(i);
        set(tc,'Color',[1,0,1]);
        set(ts,'Color',[1,0,0]);
        title([num2str(i - 1),':', num2str(q(i))]);
        fname = [num2str(i - 1),'.jpg'];
        print('-djpeg50',fname);
        %pause();
        end
    end
    ss = sum(cover) + sum(stego);
    %q m
    q1 = [m;0:255]';
    qs = sortrows(q1, 1);
    mapping = (qs(:,2) < dim)';
    %plot(m);
    %plot(d);
    %axis([1,256,0, 1]);
end